
<include file="../header" />
<style type="text/css">
    .reqairs-box a {color:#000;}
</style>
<div class="wrapper">
    <div class="main">
        <div class="header text-center font-16">
            智能报修
            <div class="iconfont icon-zuo"></div>
        </div>
        <div class="reqairs-box">
            <a class="reqairs flex" href="/Repaireast/RepaireastWorker/orderList">
                <div class="logo"><img src="/assets/repaireast/images/logo_1.png" alt=""></div>
                <div class="txt">
                    <p class="font-22">未完成工单（{BEESCRM:$num}）</p>
                    <p class="gray2">可查看所有未完成工单</p>
                </div>
            </a>
            <!--<a class="reqairs flex" href="/Repaireast/RepaireastWorker/patrolRepair">-->
            <if condition="$patrolRepair eq 0">
                <a class="reqairs flex" href="#" id="patrol_repair">
                    <div class="logo"><img src="/assets/repaireast/images/logo_2.png" alt=""></div>
                    <div class="txt">
                        <p class="font-22">日常巡检</p>
                        <p class="gray2">进行日常巡检工作</p>
                    </div>
                </a>
            </if>
            <a class="reqairs flex"  href="/Repaireast/RepaireastWorker/history">
                <div class="logo"><img src="/assets/repaireast/images/logo_3.png" alt=""></div>
                <div class="txt">
                    <p class="font-22">历史记录</p>
                    <p class="gray2">查看历史维修工单及巡检记录</p>
                </div>
            </a>
            <!--<a class="reqairs flex" href="/Repaireast/RepaireastWorker/publicRepair">-->
            <if condition="$publicRepair eq 0">
                <a class="reqairs flex" href="#" id="public_repair">
                    <div class="logo"><img src="/assets/repaireast/images/logo_4.png" alt=""></div>
                    <div class="txt">
                        <p class="font-22">公共报修</p>
                        <p class="gray2">适用于公共区域报修</p>
                    </div>
                </a>
            </if>
            <a class="reqairs flex" href="/Repaireast/RepaireastWorker/orderCount">
                <div class="logo"><img src="/assets/repaireast/images/logo_5.png" alt=""></div>
                <div class="txt">
                    <p class="font-22">订单统计</p>
                    <p class="gray2">可查看历史维修订单数据</p>
                </div>
            </a>
        </div>
    </div>


</div>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="/assets/repaireast/js/layer.js"></script>
<script src="/assets/repaireast/js/public.js"></script>
<script type="text/javascript">
    wx.config({
        debug: false,
        appId: "{BEESCRM:$appid}",
        timestamp: "{BEESCRM:$timestamp}",
        nonceStr: "{BEESCRM:$noncestr}",
        signature: "{BEESCRM:$signature}",
        jsApiList: ['checkJsApi', 'scanQRCode'],
    });
    wx.ready(function () {
        //调起扫码
        $('#patrol_repair').click(function(){
            wx.scanQRCode({
                needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                scanType: ["qrCode"], // 可以指定扫二维码还是一维码，默认二者都有
                success: function (res) {
                    //var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                    var id = res.resultStr;
                    if(id.indexOf("patrol_id") > 0 ){
                    	var url = '/Repaireast/RepaireastWorker/patrolRepair/patrol_id/'+id;
                    	window.location.href = url;
                    }else{
                    	fm.alert("请扫描正确的二维码！");
                    }
                }
            });
        });
        $('#public_repair').click(function(){
            wx.scanQRCode({
                needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                scanType: ["qrCode"], // 可以指定扫二维码还是一维码，默认二者都有
                success: function (res) {
                    //var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                    var id = res.resultStr;
                    if(id.indexOf("public_id") > 0 ){
                    	var url = '/Repaireast/RepaireastWorker/publicRepair/public_id/'+id;
                    	window.location.href = url;
                    }else{
                    	fm.alert("请扫描正确的二维码！");
                    }
                }
            });
        });
    });
</script>
<include file="../footer" />